/**
 * @desc   资金
 * @param  {String}
 * @return {Boolean} 
 */

/* layout */
import Layout from '../views/layout/Layout';

/* logiLayout */
const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);

// 资金---服务管理 --- cm
const serviceContent = resolve => require(['../views/serviceManage/serviceContent'], resolve);
const serviceOrder = resolve => require(['../views/serviceManage/serviceOrder'], resolve);
const serviceConfig = resolve => require(['../views/serviceManage/serviceConfig'], resolve);
const serviceAudit = resolve => require(['../views/serviceManage/serviceAudit'], resolve);
const orderStatistics = resolve => require(['../views/serviceManage/orderStatistics'], resolve);
const agentStatistics = resolve => require(['../views/serviceManage/agentStatistics'], resolve);
const schoolStatistics = resolve => require(['../views/serviceManage/schoolStatistics'], resolve);
const orderDetails = resolve => require(['../views/serviceManage/orderDetails'], resolve);

const newServiceAudit = resolve => require(['../views/serviceManage/newServiceAudit'], resolve);
const setService = resolve => require(['../views/serviceManage/comps/setService'], resolve);
const getService = resolve => require(['../views/serviceManage/comps/getService'], resolve);


// 资金---卡券管理
const cardStatistics = resolve => require(['../views/cardCoupons/cardStatistics'], resolve); // 卡券统计
const cardDetails = resolve => require(['../views/cardCoupons/cardDetails'], resolve); // 卡券详情
const cardDetailsCheck = resolve => require(['../views/cardCoupons/cardDetailsCheck'], resolve); // 卡券详情查看
const cardAudit = resolve => require(['../views/cardCoupons/cardAudit'], resolve); // 卡券审核
const cardExtend = resolve => require(['../views/cardCoupons/cardExtend'], resolve); // 卡券发放
const cardExtendCheck = resolve => require(['../views/cardCoupons/cardExtendCheck'], resolve); // 卡券发放查看

const cardManage = resolve => require(['../views/cardCoupons/cardManage'], resolve);// 新卡券管理
const cardReview = resolve => require(['../views/cardCoupons/comps/cardReview'], resolve);// 新卡券审核
const cardView = resolve => require(['../views/cardCoupons/comps/cardView'], resolve);// 新卡券查看
const cardData = resolve => require(['../views/cardCoupons/comps/cardData'], resolve);// 新卡券发放情况
const cardGet = resolve => require(['../views/cardCoupons/cardGet'], resolve);// 新卡券查询

const primarilyCard = resolve => require(['../views/cardCoupons/primarilyCard'], resolve);// 初审卡券
const getCard = resolve => require(['../views/cardCoupons/comps/getCard'], resolve);// 初审卡券
const setCard = resolve => require(['../views/cardCoupons/comps/setCard'], resolve);// 初审卡券


// 资金-----经销商结算
const dealersManagement = resolve => require(['../views/dealersManagement/dealersManagement'], resolve);
// const agentTrial = resolve => require(['../views/settleManagement/comps/agentTrial'], resolve);
const agentComposite = resolve => require(['../views/dealersManagement/agentComposite'], resolve);
const agentTransfer = resolve => require(['../views/dealersManagement/agentTransfer'], resolve);
const getDetails = resolve => require(['../views/dealersManagement/getDetails'], resolve);

// 资金-----一卡通结算
const unifySettlement = resolve => require(['../views/unifySettlement/unifySettlement'], resolve);
const unifyComposite = resolve => require(['../views/unifySettlement/unifyComposite'], resolve);
const unifyTransfer = resolve => require(['../views/unifySettlement/unifyTransfer'], resolve);
const unifyGetDetails = resolve => require(['../views/unifySettlement/unifyGetDetails'], resolve);

// 资金-----结算管理
const settleManagement = resolve => require(['../views/settleManagement/settleManagement'], resolve);
const checkDetails = resolve => require(['../views/settleManagement/checkDetails'], resolve);
const cardDetail = resolve => require(['../views/settleManagement/cardDetails'], resolve);
// 资金 ----- 积分管理 --- cm
const integralStatistics = resolve => require(['../views/integralManage/integralStatistics'], resolve);
const opInteManage = resolve => require(['../views/integralManage/opInteManage'], resolve);
const rechargeRecord = resolve => require(['../views/integralManage/rechargeRecord'], resolve);
const withdrawManage = resolve => require(['../views/integralManage/withdrawManage'], resolve);
const integralDeduction = resolve => require(['../views/integralManage/integralDeduction'], resolve);
const newIntegralDeduction = resolve => require(['../views/integralManage/newIntegralDeduction'], resolve);

// 用户结算

const mentionManagement = resolve => require(['../views/mentionManagement/mentionManagement'], resolve);
const mentionComposite = resolve => require(['../views/mentionManagement/mentionComposite'], resolve);
const mentionTransfer = resolve => require(['../views/mentionManagement/mentionTransfer'], resolve);

// 资金---一卡通流水
const onecardManagement = resolve => require(['../views/onecardManagement/onecardManagement'], resolve);

// 资金---账户管理
const accountManagement = resolve => require(['../views/accountManagement/accountManagement'], resolve);
const schoolDetail = resolve => require(['../views/accountManagement/schoolDetail'], resolve);
const agentDetail = resolve => require(['../views/accountManagement/agentDetail'], resolve);
const checkFigure = resolve => require(['../views/accountManagement/checkFigure'], resolve);
const checkIntergral = resolve => require(['../views/accountManagement/checkIntergral'], resolve);
const schoolList = resolve => require(['../views/accountManagement/schoolList'], resolve);
const agentList = resolve => require(['../views/accountManagement/agentList'], resolve);
const exUserList = resolve => require(['../views/accountManagement/exUserList'], resolve);

// 资金-----账户审核 
const examineMangement = resolve => require(['../views/examineMangement/examineMangement'], resolve);
const examDetail = resolve => require(['../views/examineMangement/examDetail'], resolve);
const checkExam = resolve => require(['../views/examineMangement/checkExam'], resolve);

// 资金-----会员体系 
const chargeSetting = resolve => require(['../views/memberMangement/chargeSetting'], resolve);// 收费设置
const activationCode = resolve => require(['../views/memberMangement/activationCode'], resolve);// 激活码审核
const checkCode = resolve => require(['../views/memberMangement/checkCode'], resolve);// 查看激活码
const memberOrder = resolve => require(['../views/memberMangement/memberOrder'], resolve);// 会员订单
const otherOrder = resolve => require(['../views/memberMangement/otherOrder'], resolve);// 其他订单
const packingOrder = resolve => require(['../views/memberMangement/packingOrder'], resolve);// 会员打包订单
const packingOrderDetail = resolve => require(['../views/memberMangement/packingOrderDetail'], resolve);// 会员打包订单详情
const newVip = resolve => require(['../views/memberMangement/newVip'], resolve);// 新会员收费
const editVip = resolve => require(['../views/memberMangement/comps/editVip'], resolve);// 编辑-会员服务
const editclassroom = resolve => require(['../views/memberMangement/comps/editclassroom'], resolve);// 编辑-空中课堂
const editPeace = resolve => require(['../views/memberMangement/comps/editPeace'], resolve);// 编辑-报平安
const editHomeContact = resolve => require(['../views/memberMangement/comps/editHomeContact'], resolve);// 编辑-家校通
const editELive = resolve => require(['../views/memberMangement/comps/editELive'], resolve);// 编辑-e直播
const getCheck = resolve => require(['../views/memberMangement/comps/getCheck'], resolve);// 查看页

// 资金----新手任务
const newTask = resolve => require(['../views/newTask/newTask'], resolve);// 新手任务
const taskDetail = resolve => require(['../views/newTask/taskDetail'], resolve);// 新手任务

// 发票
const ticket = resolve => require(['../views/ticketManagement/ticket'], resolve);// 发票列表


// 资金
export const fundRouterMap = [{
    path: '/',
        // component: Layout,
    name: '资金',
    redirect: '/serviceManage',
    hidden: true
        // children: [{ path: 'serviceContent', component: serviceContent }]
},
{
    path: '/serviceManage',
    redirect: '/serviceManage/serviceContent',
    name: '服务管理',
    component: Layout,
    icon: 'zujian',
    meta: { role: ['admin', '服务管理'] },
    noDropdown: false,
    children: [
        { path: 'serviceContent', component: serviceContent, name: '服务内容' },
        {
            path: '/serviceOrder',
            redirect: '/serviceOrder/orderStatistics',
            name: '服务订单',
            component: serviceOrder,
            noDropdown: false,
            children: [
                { path: 'orderStatistics', component: orderStatistics, name: '订单统计' },
                { path: 'agentStatistics', component: agentStatistics, name: '经销商统计' },
                { path: 'schoolStatistics', component: schoolStatistics, name: '学校统计' },
                { path: 'orderDetails', component: orderDetails, name: '订单明细' }
            ]
        },
            /* 旧的 1.3.0 */
            // { path: 'serviceConfig', component: serviceConfig, name: '服务配置' },
            // { path: 'serviceAudit', component: serviceAudit, name: '服务审核' },
            /* 新增 1.3.0 */
        {
            path: '/newServiceAudit', 
            redirect: '/newServiceAudit/newServiceAudit', 
            name: '服务审核',
            component: logiLayout,
            noDropdown: true,
            children: [
                { path: 'newServiceAudit', component: newServiceAudit },
                { path: 'setService/:id?/:schoolId?/:serviceTypeId?', component: setService, name: '审核页' },
                { path: 'getService/:id?/:schoolId?/:serviceTypeId?', component: getService, name: '查看页' }
            ]
        }
    ]
},
{
    path: '/cardCoupons',
    component: Layout,
    redirect: '/cardCoupons/statistics',
    name: '卡券管理',
    icon: 'zujian',
    noDropdown: false,
    meta: { cache: 'cardDetails,cardExtend' },
    children: [
            /* 旧的 1.3.0 */
            // { path: 'statistics', component: cardStatistics, name: '卡券统计' },
            // {
            //     path: '/cardCoupons/details',
            //     component: logiLayout,
            //     redirect: 'details/list',
            //     name: '卡券订单明细',
            //     noDropdown: true,
            //     children: [
            //         { path: 'list', component: cardDetails },
            //         { path: 'detailsCheck/:id/:cardType/:serviceName', component: cardDetailsCheck, name: '查看明细' },
            //     ]
            // },
            // { path: 'audit', component: cardAudit, name: '卡券审核' },
            // {
            //     path: '/cardCoupons/extend',
            //     component: logiLayout,
            //     redirect: 'extend/list',
            //     name: '卡券发放',
            //     noDropdown: true,
            //     children: [
            //         { path: 'list', component: cardExtend },
            //         { path: 'extendCheck/:id/:schoolId', component: cardExtendCheck, name: '查看发放记录' },
            //     ]
            // }

            /* 新增 1.3.0 */
        {
            path: '/primarilyCard',
            component: logiLayout,
            redirect: '/primarilyCard/primarilyCard',
            name: '初审管理',
            noDropdown: true,
            children: [
                    { path: 'primarilyCard', component: primarilyCard },
                    { path: 'setCard/:id?', component: setCard, name: '初审申请单' },
                    { path: 'getCard/:id?', component: getCard, name: '初审查看' }
            ]
        },
        {
            path: '/cardManage',
            component: logiLayout,
            redirect: '/cardManage/cardManage',
            name: '复审管理',
            noDropdown: true,
            children: [
                    { path: 'cardManage', component: cardManage},
                    { path: 'cardReview/:id?', component: cardReview, name: '复审申请单' },
                    { path: 'cardView/:id?', component: cardView, name: '复审查看' },
                    { path: 'cardData/:id?', component: cardData, name: '卡券发放情况' }
            ]
        },
            { path: 'cardGet', component: cardGet, name: '卡券查询' }
    ]
},
    // edit by cuihd at 20180719 结算管理模块隐藏
    // {
    //     path: '/settleManagement',
    //     component: Layout,
    //     name: '结算管理',
    //     icon: 'theme',
    //     noDropdown: true,
    //     meta: { cache: 'settleManagement' },
    //     redirect: '/settleManagement/settleManagement',
    //     children: [
    //         { path: 'settleManagement', component: settleManagement, name: '结算管理' },
    //         { path: 'checkDetails/:pId?', component: checkDetails, name: '查看详情' },
    //         { path: 'cardDetail/:pId?', component: cardDetail, name: '查看一卡通详情' },
    //     ]
    // },
{
    path: '/dealersManagement',
    component: Layout,
    name: '经销商结算',
    icon: 'theme',
    noDropdown: false,
    meta: { cache: 'dealersManagement,agentComposite,agentTransfer' },
    redirect: '/dealersManagement/dealersManagement',
    children: [{
        path: '/dealersManagement',
        component: logiLayout,
        redirect: '/dealersManagement/dealersManagement',
        name: '初审',
        noDropdown: true,
        children: [
                    { path: 'dealersManagement', component: dealersManagement },
                    { path: 'getDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: getDetails, name: '查看详情' }
        ]
    },
    {
        path: '/agentComposite',
        component: logiLayout,
        redirect: '/dealersManagement/agentComposite',
        name: '复核',
        noDropdown: true,
        children: [
                    { path: 'agentComposite', component: agentComposite },
                    { path: 'getDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: getDetails, name: '查看详情' }
        ]
    },
    {
        path: '/agentTransfer',
        component: logiLayout,
        redirect: '/dealersManagement/agentTransfer',
        name: '转账处理',
        noDropdown: true,
        children: [
                    { path: 'agentTransfer', component: agentTransfer },
                    { path: 'getDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: getDetails, name: '查看详情' }
        ]
    }
    ]
},
{
    path: '/unifySettlement',
    component: Layout,
    name: '一卡通结算',
    icon: 'theme',
    noDropdown: false,
    meta: { cache: 'unifySettlement' },
    redirect: '/unifySettlement/unifySettlement',
    children: [{
        path: '/unifySettlement',
        component: logiLayout,
        redirect: '/unifySettlement/unifySettlement',
        name: '初审',
        noDropdown: true,
        children: [
                    { path: 'unifySettlement', component: unifySettlement},
                    { path: 'unifyGetDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: unifyGetDetails, name: '查看详情' }
        ]
    },
    {
        path: '/unifyComposite',
        component: logiLayout,
        redirect: '/unifySettlement/unifyComposite',
        name: '复核',
        noDropdown: true,
        children: [
                    { path: 'unifyComposite', component: unifyComposite },
                    { path: 'unifyGetDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: unifyGetDetails, name: '查看详情' }
        ]
    },
    {
        path: '/unifyTransfer',
        component: logiLayout,
        redirect: '/unifySettlement/unifyTransfer',
        name: '转账处理',
        noDropdown: true,
        children: [
                    { path: 'unifyTransfer', component: unifyTransfer },
                    { path: 'unifyGetDetails/:id?/:orgUserId?/:state?/:startTime?/:endTime?', component: unifyGetDetails, name: '查看详情' }
        ]
    }
    ]
},
{
    path: '/onecardManagement',
    component: Layout,
    name: '一卡通流水',
    icon: 'theme',
    noDropdown: true,
    redirect: '/onecardManagement/onecardManagement',
    meta: {
        cache: 'onecardManagement'
    },
    children: [
            { path: 'onecardManagement', component: onecardManagement, name: '一卡通流水' }
    ]
},
{
    path: '/integralManage',
    redirect: '/integralManage/integralStatistics',
    name: '积分管理',
    component: Layout,
    icon: 'tubiaoleixingzhengchang',
    noDropdown: false,
    meta: { cache: 'integralStatistics,opInteManage' },
    children: [{
        path: '/integralManage',
        component: logiLayout,
        redirect: '/integralManage/integralStatistics',
        name: '积分统计',
        noDropdown: true,
        children: [
                    { path: 'integralStatistics', component: integralStatistics },
                    { path: 'opInteManage', component: opInteManage, name: '运营积分管理' }
        ]
    },
            { path: 'rechargeRecord', component: rechargeRecord, name: '充值记录' },
            /* 旧的 1.3.0 */
            // { path: 'integralDeduction', component: integralDeduction, name: '积分抵扣规则设置' },
            /* 新增 1.3.0 */
            { path: 'newIntegralDeduction', component: newIntegralDeduction, name: '积分抵扣规则设置' }
            // { path: 'withdrawManage', component: withdrawManage, name: '提现管理' }
    ]
},
{
    path: '/mentionManagement',
    component: Layout,
    name: '用户结算',
    icon: 'theme',
    noDropdown: false,
    meta: { cache: 'mentionManagement' },
    redirect: '/mentionManagement/mentionManagement',
    children: [
            // {
            //     path: '/mentionManagement',
            //     component: logiLayout,
            //     redirect: '/mentionManagement/mentionManagement',
            //     name: '初审',
            //     noDropdown: true,
            //     children: [
            //         { path: 'mentionManagement', component: mentionManagement }
            //     ]
            // },
            { path: 'mentionManagement', component: mentionManagement, name: '初审' },
            { path: 'mentionComposite', component: mentionComposite, name: '复核' },
            { path: 'mentionTransfer', component: mentionTransfer, name: '转账处理' }
    ]
},
{
    path: '/accountManagement',
    component: Layout,
    redirect: '/accountManagement/accountManagement',
    name: '账户管理',
    icon: 'EXCEL',
    meta: { cache: 'accountManagement' },
    noDropdown: false,
    children: [
        {
            path: '/accountManagement',
            component: logiLayout,
            redirect: '/accountManagement/schoolList',
            name: '学校',
            noDropdown: true,
            children: [
                    { path: 'schoolList', component: schoolList},
                    { path: 'schoolDetail/:id?', component: schoolDetail, name: '查看学校账户银行卡' }
            ]
        },
        {
            path: '/accountAgent',
            component: logiLayout,
            redirect: '/accountAgent/agentList',
            name: '经销商',
            noDropdown: true,
            children: [
                    { path: 'agentList', component: agentList},
                    { path: 'agentDetail/:id?', component: agentDetail, name: '查看经销商账户银行卡' }
            ]
        },
        {
            path: '/accountExUser',
            component: logiLayout,
            redirect: '/accountExUser/exUserList',
            name: 'e学云用户',
            noDropdown: true,
            children: [
                    { path: 'exUserList', component: exUserList},
                    { path: 'checkIntergral/:id?', component: checkIntergral, name: '积分详情' },
                    { path: 'checkFigure/:id?', component: checkFigure, name: '余额详情' }
            ]
        }
            // { path: 'accountManagement', component: accountManagement, name: '学校' },
            // { path: 'accountManagement', component: accountManagement, name: '经销商' },
            // { path: 'accountManagement', component: accountManagement, name: 'e学云用户' },
            // { path: 'schoolDetail/:id?', component: schoolDetail, name: '查看学校账户银行卡' },
            // { path: 'agentDetail/:id?', component: agentDetail, name: '查看经销商账户银行卡' },
            // { path: 'checkIntergral/:id?', component: checkIntergral, name: '积分详情' },
            // { path: 'checkFigure/:id?', component: checkFigure, name: '余额详情' }
    ]
},
{
    path: '/examineMangement',
    component: Layout,
    redirect: '/examineMangement/examineMangement',
    name: '银行卡审核',
    icon: 'mima',
    meta: { cache: 'examineMangement' },
    noDropdown: true,
    children: [
            { path: 'examineMangement', component: examineMangement },
            { path: 'examDetail/:id?/:orgId?/:oder?', component: examDetail, name: '审核银行卡' },
            { path: 'checkExam/:id?/:orgId?/:oder?', component: checkExam, name: '查看银行卡' }
    ]
},
{
    path: '/memberMangement',
    redirect: '/memberMangement/chargeSetting',
    name: '会员管理',
    component: Layout,
    icon: 'tubiaoleixingzhengchang',
    noDropdown: false,
    meta: { cache: 'activationCode,packingOrder' },
    children: [
            // { path: 'chargeSetting', component: chargeSetting, name: '收费设置' },
        // {
        //     path: '/activation',
        //     component: logiLayout,
        //     redirect: '/activation/activationCode',
        //     name: '激活码审核',
        //     noDropdown: true,
        //     children: [
        //             { path: 'activationCode', component: activationCode},
        //             { path: 'checkCode/:id?', component: checkCode, name: '查看激活码' }
        //     ]
        // },
        { path: 'memberOrder', component: memberOrder, name: '会员订单' },
        // {
        //     path: '/packingList',
        //     component: logiLayout,
        //     redirect: '/packingList/packingOrder',
        //     name: '会员打包订单',
        //     noDropdown: true,
        //     children: [
        //             { path: 'packingOrder', component: packingOrder},
        //             { path: 'packingOrderDetail/:id?', component: packingOrderDetail, name: '会员打包订单详情' }
        //     ]
        // },
        // { path: 'otherOrder', component: otherOrder, name: '学习礼包订单' },
            /* 新增1.3.0*/
        { 
            path: '/newVip', 
            component: logiLayout, 
            redirect: '/newVip/newVip',
            name: '新会员收费',
            noDropdown: true,
            children: [
                    { path: 'newVip', component: newVip},
                    { path: 'editVip/:id?/:name?', component: editVip, name: '编辑-会员服务'},
                    { path: 'editclassroom/:id?/:name?', component: editclassroom, name: '编辑-空中课堂'},
                    { path: 'editPeace/:id?/:name?', component: editPeace, name: '编辑-报平安'},
                    { path: 'editHomeContact/:id?/:name?', component: editHomeContact, name: '编辑-家校通'},
                    { path: 'editELive/:id?/:name?', component: editELive, name: '编辑-e直播'},
                    { path: 'getCheck/:id?/:name?', component: getCheck, name: '查看页'}
            ]
        }
            
    ]
},
{
    path: '/newTask',
    redirect: '/newTask/list',
    name: '新手任务',
    component: Layout,
    icon: 'qianshoushenpitongguo',
    noDropdown: true,
        // meta: { cache: 'newTask,taskDetail' },
    children: [
            { path: 'list', component: newTask, name: '新手任务' },
            { path: 'listDetail/:id?', component: taskDetail, name: '详情' }

    ]
},
{
    path: '/ticketManagement',
    redirect: 'ticketManagement/ticket',
    name: '发票管理',
    component: Layout,
    icon: 'EXCEL',
    noDropdown: true,
    children: [
            { path: 'ticket', component: ticket}
    ]
},
    { path: '*', redirect: '/404', hidden: true }
];
export default fundRouterMap
